package Kafka_model_game

class Games {

	var gname = ""
	var author = ""
	var score = ""
	var description = ""
	var category = ""
	var grank = ""

	def this(data: Map[String, Any]) {
		this()
		gname = getData(data.get("game_name").toString)
		author = getAuthor(getData(data.get("game_author").toString))
		score = getData(data.get("game_score").toString)
		description = getDescription(getData(data.get("game_description").toString))
		category = getData(data.get("game_type").toString)
		grank = getData(data.get("game_rank").toString)
	}

	def getData(s: String): String = {
		val rs = s.drop(5)
		rs.dropRight(1)
	}

	def getAuthor(s: String): String = {
		s.drop(11)
	}

	def getDescription(s: String): String = {
		s.drop(13)
	}
}
